package savet.entidades.atributos;

import java.util.Date;
import savet.util.DataUtil;

/**
 *
 * @author Adisson Marinho
 */
public class AlteracaoRemuneracao {

    private Date data;

    private double remuneracao;

    public AlteracaoRemuneracao() {
        this(null, 0.0);
    }

    public AlteracaoRemuneracao(Date data, double remuneracao) {
        this.data = data;
        this.remuneracao = remuneracao;
    }

    public Date getData() {
        return data;
    }

    public void setData(Date data) {
        this.data = data;
    }

    public double getRemuneracao() {
        return remuneracao;
    }

    public void setRemuneracao(double remuneracao) {
        this.remuneracao = remuneracao;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AlteracaoRemuneracao other = (AlteracaoRemuneracao) obj;
        if (this.data != other.data && (this.data == null || !this.data.equals(other.data))) {
            return false;
        }
        if (Double.doubleToLongBits(this.remuneracao) != Double.doubleToLongBits(other.remuneracao)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.data != null ? this.data.hashCode() : 0);
        hash = 79 * hash + (int) (Double.doubleToLongBits(this.remuneracao) ^ (Double.doubleToLongBits(this.remuneracao) >>> 32));
        return hash;
    }

    @Override
    public String toString() {
        return remuneracao + " alterada em " + DataUtil.converteDateToString(data, "dd/MM/yyyy");
    }

}
